<template>
  <div class="game">
    <div class="game-type">
      <div class="game-type-left">
        <div @click="changeType(1)" :class="[gameType==1?'type-active':'']">
          <img v-if="gameType==1" src="../../assets/img/youxi.png" alt />
          <img v-else src="../../assets/img/youxibai.png" alt />
          <span>游戏大厅</span>
          <img v-show="gameType==1?true:false" src="../../assets/img/sanjiao.png" alt />
        </div>
        <div @click="changeType(2)" :class="[gameType==2?'type-active':'']">
          <img v-if="gameType==2" src="../../assets/img/saigup xuanzhong.png" alt />
          <img v-else src="../../assets/img/saiguo.png" alt />
          <span>游戏赛果</span>
          <img v-show="gameType==2?true:false" src="../../assets/img/sanjiao.png" alt />
        </div>
      </div>
      <div class="game-type-right">
        <div>
          <span>电竞规则</span>
        </div>
        <div>
          <span>公告</span>
        </div>
      </div>
    </div>
    <div class="game-content">
      <gameLobby v-if="gameType==1"></gameLobby>
      <gameResult v-else></gameResult>
    </div>
  </div>
</template>

<script>
import gameLobby from '../../components/gameLobby/gameLobby'
import gameResult from '../../components/gameResult/gameResult'
export default {
  name: "game",
  data() {
    return {
      gameType: 1
    };
  },
  components:{
    gameLobby,
    gameResult
  },
  methods: {
    changeType(val) {
      this.gameType = val;
      // console.log(this.gameType);
    }
  }
};
</script>

<style lang='less' scope>
.game {
  .game-type {
    height: 70px;
    width: 100%;
    background-color: #252A48;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .game-type-left {
      display: flex;
      justify-content: flex-start;
      > div {
        height: 70px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        color: #8990c5;
        font-size: 14px;
        padding: 0 15px;
        cursor: pointer;
        > span {
          margin: 0 10px;
        }
      }
    }
    .game-type-right {
      display: flex;
      justify-content: flex-start;
      align-items: center;
      > div {
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 12px;
        color: #8990c5;
        padding: 8px 15px;
        border-radius: 20px;
        border: 1px solid #696d86;
        margin-left: 10px;
        width: 120px;
        cursor: pointer;
        > span {
          margin-left: 20px;
        }
      }
      > div:nth-child(1) {
        background: url("../../assets/img/guizean.png") no-repeat 20px 8px;
      }
      > div:nth-child(1):hover {
        background: url("../../assets/img/guizeliang.png") no-repeat 20px 8px;
        color: #cfa66e;
        border: 1px solid #cfa66e;
      }
      > div:nth-child(2) {
        background: url("../../assets/img/gonggaoan.png") no-repeat 30px 8px;
      }
      > div:nth-child(2):hover {
        background: url("../../assets/img/gonggaoliang.png") no-repeat 30px 8px;
        color: #cfa66e;
        border: 1px solid #cfa66e;
      }
    }
  }
  .game-content{
    background-color: #151A36;
    padding: 10px;
  }
}

.type-active {
  color: #cfa66e !important;
  border-top: 4px solid #cfa66e;
  background: linear-gradient(#175f68 5%, #252a48 95%) !important;
}
.type-active2 {
  color: #cfa66e !important;
  border: 1px solid #cfa66e !important;
}
</style>
